<#list mapping.entities as entity><#t/>
drop table ${entity.data.tableName!""} if exists;

</#list><#t/>

<#list mapping.entities as entity><#t/>
<#list entity.keyProperties as property><#t/>
<#if property.hasSequence><#t/>
drop sequence ${property.data.sequenceName!""};

</#if><#t/>
</#list><#t/>
</#list><#t/>

<#list mapping.entities as entity><#t/>
create table ${entity.data.tableName!""} (
<#list entity.properties as property><#t/>
	${property.data.columnName!""} ${property.dbType}<#if property.isNotNull> not null</#if>,
</#list><#t/>
	primary key (${entity.keyColumns})
);

</#list><#t/>

<#list mapping.entities as entity><#t/>
<#list entity.keyProperties as property><#t/>
<#if property.hasSequence><#t/>
create sequence ${property.data.sequenceName!""};

</#if><#t/>
</#list><#t/>
</#list><#t/>
